From: Florian Müllner Date: Wed, 11 Mar 2015 19:44:10 +0000 (+0100) Subject: legacyTray: Add to ctrl-alt-tab X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1498 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=775a2ea051b2179764c38d23ace6d8c898eb77ce;p=gnome-shell.git legacyTray: Add to ctrl-alt-tab While legacy status icons are notoriously bad with regard to accessibility (well, among many other things), we should still make them available via ctrl-alt-tab ... https://bugzilla.gnome.org/show_bug.cgi?id=746022 --- diff --git a/js/ui/legacyTray.js b/js/ui/legacyTray.js index f3d8613a0..8c23167ed 100644 --- a/js/ui/legacyTray.js +++ b/js/ui/legacyTray.js @@ -3,6 +3,7 @@ const GObject = imports.gi.GObject; const Shell = imports.gi.Shell; const St = imports.gi.St; +const CtrlAltTab = imports.ui.ctrlAltTab; const Lang = imports.lang; const Layout = imports.ui.layout; const Main = imports.ui.main; @@ -53,7 +54,10 @@ const LegacyTray = new Lang.Class({ this._box = new St.BoxLayout(); this._slider.add_actor(this._box); - this._concealHandle = new St.Button({ style_class: 'legacy-tray-handle' }); + this._concealHandle = new St.Button({ style_class: 'legacy-tray-handle', + /* translators: 'Hide' is a verb */ + accessible_name: _("Hide tray"), + can_focus: true }); this._concealHandle.child = new St.Icon({ icon_name: 'go-previous-symbolic' }); this._box.add_child(this._concealHandle); @@ -83,6 +87,9 @@ const LegacyTray = new Lang.Class({ Main.layoutManager.addChrome(this.actor, { affectsInputRegion: false }); Main.layoutManager.trackChrome(this._slider, { affectsInputRegion: true }); + Main.ctrlAltTabManager.addGroup(this.actor, + _("Status Icons"), 'focus-legacy-systray-symbolic', + { sortGroup: CtrlAltTab.SortGroup.BOTTOM }); this._trayManager = new Shell.TrayManager(); this._trayIconAddedId = this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded)); @@ -121,14 +128,20 @@ const LegacyTray = new Lang.Class({ return; let button = new St.Button({ child: icon, + style_class: 'legacy-tray-icon', button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO | St.ButtonMask.THREE, + can_focus: true, x_fill: true, y_fill: true }); button.connect('clicked', function() { icon.click(Clutter.get_current_event()); }); + button.connect('key-focus-in', Lang.bind(this, + function() { + this._concealHandle.show(); + })); this._iconBox.add_actor(button); this._sync(); diff --git a/po/POTFILES.in b/po/POTFILES.in index 69942b86d..aa535bb7d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -30,6 +30,7 @@ js/ui/endSessionDialog.js js/ui/extensionDownloader.js js/ui/extensionSystem.js js/ui/keyboard.js +js/ui/legacyTray.js js/ui/lookingGlass.js js/ui/main.js js/ui/messageTray.js